package edu.scau.cxq.gp.service.impl;

import edu.scau.cxq.gp.dto.CustomerSignDTO;
import edu.scau.cxq.gp.entity.Customer;
import edu.scau.cxq.gp.mapper.CustomerMapper;
import edu.scau.cxq.gp.service.ICustomerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 存储客户信息 服务实现类
 * </p>
 *
 * @author CXQ
 * @since 2022-01-30
 */
@Service
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements ICustomerService {

    @Autowired
    private CustomerMapper customerMapper;

    /**
     * 通过id寻找特定客户的签名
     * @param cusId
     * @return
     */
    @Override
    public String getSign(Long cusId) {
        return customerMapper.selectSignOfCustomer(cusId);
    }

    @Override
    public List<CustomerSignDTO> findCustomerSigns() {
        return customerMapper.selectAllSignOfCustomer();
    }
}
